<template>
  <el-dialog title="新增证书" v-model="dialogModel">
    <avue-form ref="formRef"
               :option="option"
               v-model="form"
               @submit="handleSubmit"></avue-form>
  </el-dialog>
</template>

<script setup>
import { reactive, ref } from 'vue';

const dialogModel = ref(false);
const option = reactive({
  column: [
    {
      label: '证书名称',
      prop: 'name',
      type: 'input',
      rules: [
        {
          required: true,
          message: '请输入证书名称'
        }
      ]
    },
    {
      label: '证书编号',
      prop: 'code',
      type: 'input',
      rules: [
        {
          required: true,
          message: '请输入证书编号'
        }
      ]
    },
    {
      label: '持证人',
      prop: 'code',
      type: 'input',
      rules: [
        {
          required: true,
          message: '请输入持证人'
        }
      ]
    },
    {
      label: '持证人工号',
      prop: 'code',
      type: 'input'
    },
    {
      label: '证书类型',
      prop: 'code',
      type: 'input'
    },
    {
      label: '证书等级',
      prop: 'code',
      type: 'input'
    }
  ]
});
const form = ref({});

function handleSubmit(form, done) {
  console.log(form);
  done();
}

defineExpose({
  open() {
    dialogModel.value = true;
  }
});
</script>

<style scoped>

</style>